<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" href="http://hd.com/code/shopping/Static/Bootstrap/Css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="http://hd.com/code/shopping/Static/hdjs/hdjs.css"/>
	<link rel="stylesheet" href="http://hd.com/code/shopping/Static/admin/Css/common.css" />
	<script src="http://hd.com/code/shopping/Static/js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="http://hd.com/code/shopping/Static/hdjs/hdjs.min.js" type="text/javascript" charset="utf-8"></script>
	<style type="text/css">
		body{
			margin-bottom: 100px;
		}
            .page_hdcms{
                width:500px;
                margin-top: 20px;
                text-align: center;
                margin:0 auto;
                
                
            }
            .page_hdcms a{
                padding: 3px 5px;
                margin-left: 3px;
                border: 1px solid #CCCCCC;
                
            }
            .page_hdcms strong{
                padding: 3px 5px;
                margin-left: 3px;
                background: red;
                color: white;
            }
            .page_hdcms span{
                float: none;font-size: 12px;
            }
	</style>
</head>
<body>
	<div class="container-fluid">
	<div class="row-fluid">
	<div class="span12">

	<table class="table table-bordered table-hover">
		<tr>
			<th>ID</th>
			<th>商品名称</th>
			<th>价格</th>
			<th>库存</th>
			<th>点击次数</th>
			<th>添加时间</th>
			<th>操作</th>
		</tr>

		<?php foreach ($goods as $k=>$v){?>
			<tr class="info">
				<td><?php echo $v['gid'];?></td>
				<td>
					<a href="" target='_blank'><?php echo $v['gname'];?></a>
				</td>
				<td>
					<ul>
						<li>市场价：<del>&yen;<?php echo $v['sales_price'];?></del></li>
						<li>商城价：<span>&yen;<?php echo $v['shop_price'];?></span></li>
					</ul>
				</td>
				<td>
					<?php echo $v['fqty'];?>
				</td>
				<td><?php echo $v['click'];?></td>
				<td><?php echo $v['time'];?></td>
				<td>
					<a href="<?php echo U('GoodsList/index',array('gid' => $v['gid']));?>" class="btn btn-success"><i class="icon-th icon-white"></i>货品列表</a>
					<a href="<?php echo U('edit',array('gid' => $v['gid']));?>" class="btn btn-warning"><i class="icon-pencil icon-white"></i>修改</a>
					<a href="javascript:del_modal(<?php echo $v['gid'];?>);" class="btn btn-danger"><i class="icon-trash icon-white"></i>删除</a>
				</td>
			</tr>
		<?php }?>
	</table>
        <div class="page_hdcms">
            <?php echo $page;?>
        </div>
	</div>
	</div>
	</div>
</body>
</html>
<script type="text/javascript">
    function del_modal(gid){
        hd_modal({
            width: 400,//宽度
            height: 120,//高度
            title: '确认删除吗？',//标题
            content: '',//提示信息
            button: true,//显示按钮
            button_success: "确定",//确定按钮文字
            button_cancel: "取消",//关闭按钮文字
            timeout: 0,//自动关闭时间 0：不自动关闭
            shade: true,//背景遮罩
            shadeOpacity: 0.3,//背景透明度
            success: function () {//点击确定后的事件
                location.href='<?php echo U("del");?>' + '&gid=' + gid;
            },
            cancel: function () {//点击关闭后的事件

            }
        });
    }
</script>